package Homework;

import java.io.File;
import java.io.IOException;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class CreateFolder {

	public static void main(String[] args) throws IOException {
		String newFile = "abc//a.txt";
		createFile(newFile);
	}

	private static void createFile(String newFile) throws IOException {
		String[] split = newFile.split("//");
		String allParentFolderPath = IntStream.range(0, split.length-1).mapToObj(s->split[s]).collect(Collectors.joining());
		File allParentFolder = new File(allParentFolderPath);
		File file = new File(newFile);
		allParentFolder.mkdirs();
		file.createNewFile();
	}

	
}
